// Copyright (C) 2011 Bill Lee <bill.lee.y@gmail.com>, 2014 Persmule <persmule@gmail.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA
//

class IantiLeech;	//forward declaretion

#include "updownclient.h"	// Needed for CUpDownClient
#include "antiLeech_wx.h"

#include <wx/dynlib.h>

class DLP
{
public:
	DLP() : antiLeech(NULL) {	DLPInitState=ReloadAntiLeech();	}
	~DLP();

	void CheckHelloTag(CUpDownClient*, UINT tagnumber);
	void CheckInfoTag(CUpDownClient*, UINT tagnumber);
	bool DLPCheck(CUpDownClient*);

	int ReloadAntiLeech();
	int GetInitState(void){return DLPInitState;}
	bool IsValid(void){return (0==DLPInitState);}

private:
	typedef IantiLeech* (*Creator)();
	typedef int (*Destoryer)(IantiLeech*);

	wxDynamicLibrary antiLeechLib;
	IantiLeech* antiLeech;
	int DLPInitState;

	bool LoadFrom(wxString& file);
};
